<?php
namespace Admin\Controller;
use Think\Page;

use Think\Controller;
class LoginController extends Controller{
	public function login(){
		
		$this->display();
	}
	public function checkuser(){
		$username = I('username');
		$temp = M('user')->where(array('username'=>$username))->find();
		if(!empty($temp)){
			$this->ajaxReturn(1,'json');
		}
		else{
			$this->ajaxReturn(0,'json');
		}
	}
	public function checkpwd(){
		$username = I('username');
		$password = M('user')->where(array('username'=>$username))->getField('password');
		if($password==md5(I('password'))){
			$this->ajaxReturn(1,'json');
		}
		else{
			$this->ajaxReturn(0,'json');
		}
	}
	public function checkcode(){
		$util = A('Util');
	    if($util->check_verify(I('code'))){
	    	$this->ajaxReturn(1,'json');
	    }
	    else{
	    	$this->ajaxReturn(1,'json');
	    }
	}
}